home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
-
- #######################################################################
- # monolingual.pl -
- # strips away extra language .lproj from OSX to save space
- #
- # Copyright (C) 02001 Joshua Schrier (jschrier@mac.com)
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- #
- #######################################################################
-
- @lang_name = ('Pig-latin','Dutch','English','French','German','Italian','Japanese','Spanish');
- @path_name = ('Applications','System','Library');
- @offset = (666,-12,-13,-13,-13,-14,-15,-14);
-
- if (!(defined($ARGV[0]))) {
- print STDOUT "\nmonolingual, Copyright (C) 02001 J. Schrier\n";
- print STDOUT "\nmonolingual comes with ABSOLUTELY NO WARRANTY; for details refer to\n";
- print STDOUT "the included documentation (readme.txt) or the script itself (monolingual.pl\n";
- print STDOUT "This is free software, and you are welcome to redistribute it\n";
- print STDOUT "under the terms of the GNU Public License (gpl.txt)\n";
-
- print STDOUT "\nLanguage to Remove:\n";
- for my $i (1..7) {
- print STDOUT "$i) $lang_name[$i]\n";
- }
- print STDOUT "Enter your selection: ";
- chop($remove = <STDIN>);
-
- print STDOUT "Are you *SURE* you want to *REMOVE ALL* $lang_name[$remove] ";
- print STDOUT "resources from OS X?\n";
- print STDOUT "You will *NOT* be able to restore them without reinstalling OS X.\n";
- print STDOUT "(Type \'yes\' to REMOVE $lang_name[$remove]) ";
-
- chop($agree = <STDIN>);
- ($agree eq "yes") || die "Your files have *NOT* been changed.\n";
- } else {
- $remove = $ARGV[0];
- }
-
- $newcheck = $lang_name[$remove].".lproj:";
-
- for my $i (0..2) {
- open(RM, "ls -R /$path_name[$i] | grep $newcheck |") || die "Couldn't open ls\n";
- while ($hold = <RM>) {
- chop($hold);
- if (substr($hold,-1) eq ":") {
- $hold =~ s/\s/\\\ /g;
- system("rm -r ".substr($hold,0,-1));
- }
- }
- close(RM);
- }
-
-
-
-
-
-
-